// 人名地名排序
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String[] strings = new String[n];
        scanner.nextLine();
        for(int i = 0; i < n; i++){
            strings[i] = scanner.nextLine();
        }
        Arrays.sort(strings);
        for(String string : strings){
            System.out.println(string);
        }
    }
}